﻿<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="NhaSanXuatEdit.aspx.cs" Inherits="NhaSanXuatEdit" Title="NhaSanXuat Edit" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Nha San Xuat - Add/Edit</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:MultiFormView ID="FormView1" DataKeyNames="MaNsx" runat="server" DataSourceID="NhaSanXuatDataSource">
		
			<EditItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/NhaSanXuatFields.ascx" />
			</EditItemTemplatePaths>
		
			<InsertItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/NhaSanXuatFields.ascx" />
			</InsertItemTemplatePaths>
		
			<EmptyDataTemplate>
				<b>NhaSanXuat not found!</b>
			</EmptyDataTemplate>
			
			<FooterTemplate>
				<asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
				<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
				<asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
			</FooterTemplate>

		</data:MultiFormView>
		
		<data:NhaSanXuatDataSource ID="NhaSanXuatDataSource" runat="server"
			SelectMethod="GetByMaNsx"
		>
			<Parameters>
				<asp:QueryStringParameter Name="MaNsx" QueryStringField="MaNsx" Type="String" />

			</Parameters>
		</data:NhaSanXuatDataSource>
		
		<br />

		<data:EntityGridView ID="GridViewSua1" runat="server"
			AutoGenerateColumns="False"	
			OnSelectedIndexChanged="GridViewSua1_SelectedIndexChanged"			 			 
			DataSourceID="SuaDataSource1"
			DataKeyNames="MaSua"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_Sua.xls"  		
			Visible='<%# (FormView1.DefaultMode == FormViewMode.Insert) ? false : true %>'	
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" />
				<asp:BoundField DataField="TenSua" HeaderText="Ten Sua" SortExpression="[TenSua]" />				
				<asp:BoundField DataField="GiaNhap" HeaderText="Gia Nhap" SortExpression="[GiaNhap]" />				
				<asp:BoundField DataField="GiaTrenBaoBi" HeaderText="Gia Tren Bao Bi" SortExpression="[GiaTrenBaoBi]" />				
				<asp:BoundField DataField="GiaBan" HeaderText="Gia Ban" SortExpression="[GiaBan]" />				
				<asp:BoundField DataField="HinhAnh" HeaderText="Hinh Anh" SortExpression="[HinhAnh]" />				
				<asp:BoundField DataField="ThongTin" HeaderText="Thong Tin" SortExpression="[ThongTin]" />				
				<data:HyperLinkField HeaderText="Ma Loai" DataNavigateUrlFormatString="LoaiSuaEdit.aspx?MaLoai={0}" DataNavigateUrlFields="MaLoai" DataContainer="MaLoaiSource" DataTextField="TenLoai" />
				<data:HyperLinkField HeaderText="Ma Nsx" DataNavigateUrlFormatString="NhaSanXuatEdit.aspx?MaNsx={0}" DataNavigateUrlFields="MaNsx" DataContainer="MaNsxSource" DataTextField="TenNsx" />
				<asp:BoundField DataField="SoLuong" HeaderText="So Luong" SortExpression="[SoLuong]" />				
			</Columns>
			<EmptyDataTemplate>
				<b>No Sua Found! </b>
				<asp:HyperLink runat="server" ID="hypSua" NavigateUrl="~/admin/SuaEdit.aspx">Add New</asp:HyperLink>
			</EmptyDataTemplate>
		</data:EntityGridView>					
		
		<data:SuaDataSource ID="SuaDataSource1" runat="server" SelectMethod="Find"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:SuaProperty Name="LoaiSua"/> 
					<data:SuaProperty Name="NhaSanXuat"/> 
					<%--<data:SuaProperty Name="AnhChiTietCollection" />--%>
				</Types>
			</DeepLoadProperties>
			
		    <Parameters>
				<data:SqlParameter Name="Parameters">
					<Filters>
						<data:SuaFilter  Column="MaNsx" QueryStringField="MaNsx" /> 
					</Filters>
				</data:SqlParameter>
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" /> 
		    </Parameters>
		</data:SuaDataSource>		
		
		<br />
		

</asp:Content>

